package com.example.design_pattern.factory.methods.creator;


import com.example.design_pattern.factory.Pizza;
import com.example.design_pattern.factory.simple.PizzaTypeEnums;

public abstract class PizzaStore {

    public final Pizza orderPizza(PizzaTypeEnums type){
        Pizza pizza;
        pizza  = createPizza(type);
        // 准备
        pizza.prepare();
        // 烘烤
        pizza.bake();
        // 切片
        pizza.cut();
        // 装盒
        pizza.box();
        return pizza;
    }

    abstract Pizza createPizza(PizzaTypeEnums type);
}
